from Tkinter import *

class StreamViewer(Frame):
     def __init__(self, root, frW = 400, frH = 300):
        self.height = frH
        self.width = frW
        self.addFrame(root)
        
     def addFrame(self,root):
          frame = Frame(root,  background="#FFFFFF", height = self.height, width = self.width)
          self.addCanvas(frame)
          frame.pack(expand=YES)
        
     def addCanvas(self, frame):
        self.canvas = Canvas(frame, background='#000000', width=self.width, height=self.height)
        self.canvas.pack(expand=YES)
        
     def addImage(self, photoimage):
          width = photoimage.width()
          height = photoimage.height()
          self.canvas.create_image(width,height, image=photoimage,anchor=SE)
          self.canvas.image = photoimage
          
